import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    redirect:'/home/car'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '../views/home/home.vue'),
    children:[
      {
        path: '/home/ind',
        name: 'Ind',
        component: () => import(/* webpackChunkName: "ind" */ '../views/home/ind/ind.vue'),
      },
      {
        path: '/home/lun',
        name: 'Lun',
        component: () => import(/* webpackChunkName: "lun" */ '../views/home/lun/lun.vue'),
      },
      {
        path: '/home/car',
        name: 'Car',
        component: () => import(/* webpackChunkName: "car" */ '../views/home/car/car.vue'),
      },
      {
        path: '/home/beji',
        name: 'Beji',
        component: () => import(/* webpackChunkName: "beji" */ '../views/home/beji/be.vue'),
      },
      {
        path: '/home/my',
        name: 'My',
        component: () => import(/* webpackChunkName: "my" */ '../views/home/my/my.vue'),
      },
    ]
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "detail" */ '../views/detail/detail.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
